<template>
	<view>
		<view class="choose">
			<view
				class="listBar"
				v-for="(item, index) in sendList"
				:key="index"
				@click="choose(item)">
				{{ item.departName }}
			</view>
		</view>
		<!-- <view class="mock" @click="close"> </view> -->
	</view>
</template>

<script>
export default {
	props: {
		sendList: {
			type: Array,
			default: [],
		},
		closeBar: {
			type: Function,
			default: null,
		},
		getId: {
			type: Function,
			default: null,
		},
	},
	methods: {
		close() {
			this.closeBar();
		},
		choose(val) {
            console.log(1)
			this.getId(val.id);
			this.closeBar();
		},
	},
	mounted() {},
};
</script>

<style lang="scss" scoped>
.choose {
	position: absolute;
	width: 120px;
	min-height: 30px;
	max-height: 200px;
	background-color: #fff;
	border-radius: 5px;
	padding: 5px;
	box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.2);
	top: 70%;
	left: 40%;
	overflow-x: auto;
	z-index: 99999;
	.listBar {
		width: 100%;
		height: 30px;
		line-height: 30px;
		font-size: 12px;
		text-align: center;
	}
}
// .mock {
// 	position: absolute;
// 	width: 100vw;
// 	height: 100vh;
// 	z-index: 111;
//     background-color: red;
// }
</style>
